namespace Aurora.TaskScheduler.Abstractions;

/// <summary>
/// 任务 分布式锁
/// </summary>
public interface ITaskDistributeLock
{
    /// <summary>
    /// 尝试获取锁
    /// </summary>
    /// <param name="taskId"></param>
    /// <param name="timeout"></param>
    /// <returns></returns>
    Task<bool> TryLockAsync(string taskId, TimeSpan timeout);

    Task<bool> TryUnlockAsync(string taskId);
}